package com.zzyang.aop.demo.rpc.consumer;

import com.zzyang.aop.demo.rpc.User;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * 式例
 *
 * @author zhuoziyang
 * @date 2021/5/19 22:31
 */
@ComponentScan("com.zzyang.aop.demo.rpc.consumer")
public class ConsumerDemo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
        applicationContext.register(ConsumerDemo.class);
        applicationContext.refresh();

        Consumer consumer = applicationContext.getBean(Consumer.class);

        consumer.say("@zzyang");

        consumer.getName(new User().setName("zzyang"));

        consumer.getName("hello", new User().setName("zzyang"));

        consumer.getName();

        applicationContext.close();
    }
}
